Add --ignore-video-encoder-constraints#6849
Conversation
|
When |
|
Or maybe this option should only apply to max/min size, not alignment? I guess the alignment reported by video capabilities will always work (except e.g. for emulators). But I'm even wondering if the supported size is really wrong. In #6769 (comment) as well as in other issues you're assuming that the encoder reports incorrect capabilities. It seems more probable that the way you compute the maximum possible size is not appropriate, as additional logs in #6769 (comment) tend to suggest (IMHO). What I mean is that I wouldn't be surprised if the encoder could handle only a limited number of pixels in total or a limited aspect ratio, something like that. Thus if you first retrieve the maximum allowed width and the encoder returns 2048, then if you ask it the maximum possible height it can handle for this width it will return 448. On the other hand, if you ask what is the maximum height for a width of, say, 1600, it would return 1200 or higher. In other words, maybe it can handle larger areas for big squares than for thin rectangles, but anyway the more you increase one dimension, the more the other dimension has to be limited. Or maybe not? How would you know a priori? You should probably test with more values on a real device. As a consequence, the decision for the maximum minor dimension should depend dynamically on the current (capped) major dimension in I don't know, just a guess. At least, did I manage to make myself clear? |
|
@anotheruserofgithub Thank you, you're right! I completely reworked the size constraint algorithm: #6859 (which replaces this PR, so I'm closing). |
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the second dimension derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR TODO
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the second dimension derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR TODO
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the dimensions derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR TODO
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the dimensions derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR #6859 <#6859>
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the dimensions derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR #6859 <#6859>
The algorithm used to constrain a size according to the video capabilities, implemented in #6766, was too simplistic: it computed the maximum landscape size by retrieving the maximum width and its associated maximum height (and vice versa for the maximum portrait size). In addition to width and height, encoders are also constrained by a maximum surface area (in blocks). As a result, it is possible for the maximum width to be 4096 with an associated maximum height of 512, while the encoder still supports 1600x1200. In that case, the previous algorithm incorrectly considered 512 to be the absolute maximum height in landscape mode. Instead, determine the optimal supported size, defined as the largest size with the same aspect ratio supported by the encoder. If preserving the aspect ratio is not required (for virtual displays), then the dimensions derived from this optimal size can be extended. Refs #6849 comment <#6849 (comment)> Refs #6766 <#6766> Refs #6848 <#6848> Fixes #6829 <#6829> PR #6859 <#6859>
Some encoders report incorrect capabilities. Add an option to ignore these constraints.
Fixes #6829
Fixes #6848